<template>
  <a-modal :open="open" width="640px" title="修改记录" centered ok-text="保存" :footer="false" @cancel="onCancel">
    <div class="h-[350px] overflow-auto pr-2">
      <div v-for="(item, index) in list" :key="index">
        <div>{{ item.createTime }}</div>
        <div>
          <span class="result-text">{{ item.createUserName }}</span>
          修改
          <span class="result-text">{{ item.mc }},{{ item.gg }},{{ item.cj }}</span>
          的皮试开始时间为<span class="result-text">{{ item.startTime }}</span
          >， 皮试结束时间为：<span>{{ item.endTime }}</span
          >， 皮试结果为 <span v-if="item.result === 0" class="result-text">阴性</span> <span v-if="item.result === 1" class="result-text">弱阳性</span
          ><span v-if="item.result === 2" class="result-text">阳性</span><span v-if="item.result === 3" class="result-text">强阳性</span>， 结果观察为<span
            class="result-text"
            >{{ item.resultDescribe }}</span
          >
        </div>
        <a-divider />
      </div>
    </div>
  </a-modal>
</template>

<script setup>
// import { ref } from 'vue'
import { message } from 'ant-design-vue'
// import { post } from '@/utils/request'

const props = defineProps({
  open: Boolean,
  rowData: {
    type: Object,
    default: () => ({})
  }
})

const emit = defineEmits(['update:open', 'success'])
const list = ref([])

const getData = async () => {
  const res = await post('/outp/mzhs/getPatientSkinTestResultUpdateRecords', {
    pageNum: 1,
    pageSize: 10000,
    brId: props.rowData?.brId
  })
  if (res.code !== 0) return message.error(res.msg || '获取信息失败')
  list.value = res.data
}

const onCancel = () => {
  emit('update:open', false)
}
watch(
  () => props.open,
  (val) => {
    if (val) {
      getData()
    }
  }
)
</script>
<style lang="less" scoped>
.ant-form {
  display: flex;
  flex-flow: row wrap;
  min-width: 0;
  :deep(.ant-form-item) {
    .ant-form-item-label {
      width: 90px;
    }
  }
  .ant-picker {
    width: 100%;
  }
}
.result-text {
  text-decoration: underline;
}
</style>
